--- template.orig	2020-11-05 21:21:21.963999000 +0600
+++ template	2020-11-06 00:39:42.816447000 +0600
@@ -45,2 +45,18 @@ fi
 
+# Liberation
+# Some of the code is taken from:
+# https://git.parabola.nu/abslibre.git/tree/libre/opencv/PKGBUILD
+post_patch() {
+	# remove nonfree Milky icons
+	rm -rv modules/highgui/src/files_Qt/Milky
+
+	# remove nonfree lena.png and lena.jpg images
+	rm -v $(find . -iname '*lena*')
+	
+	cd "${XBPS_BUILDDIR}/opencv_contrib-${version}"
+	
+	# remove nonfree SIFT and SURF algorithms that are patented in some countries and have some other limitations on the use
+	rm -rv modules/xfeatures2d
+}
+
 post_install() {
